﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Wassrile.Config.ConfigPage
{
    public partial class Detail : Krilib.Control.ConfigPage
    {
        public Detail()
        {
            InitializeComponent();
        }

        private void Detail_Load(object sender, EventArgs e)
        {
            pictBackWhite.Checked = Core.Config.Detail.pictgramBgWhiten;
            viaOverride.Checked = Core.Config.Detail.overrideVia;
            viaOverrideText.Text = Core.Config.Detail.overrideViaText;
            extractGyazo.Checked = Core.Config.Detail.extractGyazo;
            recvFriendTL.Checked = Core.Config.Detail.BootReceives.friendTL;
            getFriendTLHistoryNum.Value = Core.Config.Detail.BootReceives.friendTLPageNum;
            replyToMe.Checked = Core.Config.Detail.BootReceives.replyTL;
            getReplyToMeHistoryNum.Value = Core.Config.Detail.BootReceives.replyTLPageNum;
            myPost.Checked = Core.Config.Detail.BootReceives.myTL;
            channelFeed.Checked = Core.Config.Detail.BootReceives.channelFeed;
        }

        public override void Apply()
        {
            Core.Config.Detail.pictgramBgWhiten = pictBackWhite.Checked;
            Core.Config.Detail.overrideVia = viaOverride.Checked;
            Core.Config.Detail.overrideViaText = viaOverrideText.Text;
            Core.Config.Detail.extractGyazo = extractGyazo.Checked;
            Core.Config.Detail.BootReceives.friendTL = recvFriendTL.Checked;
            Core.Config.Detail.BootReceives.friendTLPageNum = (uint)getFriendTLHistoryNum.Value;
            Core.Config.Detail.BootReceives.replyTL = replyToMe.Checked;
            Core.Config.Detail.BootReceives.replyTLPageNum = (uint)getReplyToMeHistoryNum.Value;
            Core.Config.Detail.BootReceives.myTL = myPost.Checked;
            Core.Config.Detail.BootReceives.channelFeed = channelFeed.Checked;
        }
    }
}
